var i=0;

function timedCount()
{
i=i+1;
postMessage(i);
setTimeout("timedCount()",500);
}

timedCount();

console.log(self)//没有window对象，替代为self
console.log(self.fetch)//支持fetch
console.log(self.indexedDB)//支持indexedDB，不支持localStorage